package com.ddwl.common.feign.api;

import com.ddwl.schema.vo.funds.OrderPaymentVo;
import com.ddwl.schema.vo.funds.OrderRefundsVo;
import com.ddwl.schema.bo.funds.*;
import com.ddwl.schema.vo.base.RestVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;

/**
 * @author zach
 * @Date :2020-09-24 15:33.
 */
@FeignClient(name = "ddwl-funds" ,path = "/funds")
public interface FundsApi {


    @PostMapping("/orderPayCre")
    @ApiOperation("创建预支付订单")
    RestVo<OrderPaymentVo> create(PayOrderCreBo payOrderCreBo);

    @GetMapping("/orderPayInfo")
    @ApiOperation("查询用户订单详情")
    RestVo<OrderPaymentVo> orderPayInfo(@RequestParam("orderId") String orderId);

    @PostMapping("/refundsCre")
    @ApiOperation("创建预退款订单")
    RestVo<OrderRefundsVo> refundsCre(@Valid @RequestBody OrderRefundCreBo creBo);


    @GetMapping("/refundsInfo")
    @ApiOperation("查询退款订单详情")
    RestVo<OrderRefundsVo> refundsInfo(@RequestParam("bizRefundsNo") String bizRefundsNo);

    @PostMapping("/payment")
    @ApiOperation("微信小程序支付入口")
    RestVo<String> payment(@RequestBody FundsPaymentBo fundsPaymentBo);


    @PostMapping("/wx/notify")
    @ApiOperation("微信支付回调转发")
    String wxNotifyResult(@RequestBody String xmlData);

    @PostMapping("orderCreAndPay")
    @ApiOperation("创建订单并且返回客户端需要的支付信息")
    RestVo<String> crePayment(@Valid @RequestBody PaymentCreAndPayBo orderPayBo);

    /**
     * 付款到零钱/银行卡
     * @param bo
     * @return
     */
    @ApiOperation(value = "付款到零钱/银行卡", hidden = true)
    @PostMapping("/wx/entPay")
    RestVo entPay(@Valid @RequestBody WxEntPayBo bo);
}
